class Solution {
public:
    int evalRPN(vector<string>& tokens) {
     stack<long long> stk;
     for( int i=0;i<tokens.size();i++){
      if (tokens[i]=="+" || tokens[i]=="-" ||tokens[i]=="*" || tokens[i]=="/"){
          long long num1=stk.top();
          stk.pop();
          long long num2=stk.top();
          stk.pop();
          if(tokens[i]=="+") stk.push(num2+num1);
          if(tokens[i]=="-") stk.push(num2-num1);
          if(tokens[i]=="*") stk.push(num2*num1);
          if(tokens[i]=="/") stk.push(num2/num1);
      }
     else {
         stk.push(stoll(tokens[i]));
     }
     }
    int result=stk.top();
    return result;
    }
};
